/*
 * @Author: zhangenze
 * @Date: 2025-03-20 20:44:01
 * @LastEditors: zhangenze
 * @LastEditTime: 2025-03-20 23:50:05
 * @important: 重要提醒
 * @Description: 备注内容
 * @FilePath: /shop-ai-destiny/src/bridge/other.js
 */
import ROUTES from "./routes";
import core from "./core";

export default class other extends core {
    constructor() {
        super();
    }
    defineFunc() {
        /**
         * 用来显示debug相关方法
         */
        window.TongBridge = {
            paths: {},
            tokenExpired: () => {},
            newWebview: path => {
                window.location.href = path;
            },
            showImage: val => {
                alert(val);
            },
            showShareDialog: () => {},
            setStatusBarDarkFont: () => {},
            setMainTabVisibility: () => {},
            vibrate: () => {},
            uploadSuccess: () => {},
            chooseImage: () => {},
            cancelUpload: () => {},
            getClientInfo: () => {
                return JSON.stringify(window.TongBridge.clientInfo);
            },
            routeTo: () => {},
            enableBackForward: () => {},
            gPayOpenIdentityVerifiedPage: () => {}, // 实名认证
            gPayOpenToPay: () => {}, // 国美支付sdk
            gPayAddInfomation: () => {}, // 证件过期，完善信息
            gPayFaceRecognition: () => {}, // 人脸识别
            redEnvelopeReceiveDetail: () => {}, // 红包详情
            setMainTabCover: () => {}, // 底部tab是否显示遮罩
            makeTelephoneCall: () => {}, // 打电话
            openLocalMapList: () => {}, // 打开本地地图
            routeToMomentVideo: () => {}, // 跳转到短视频
            goto: path => {
                window.location.href = path;
            },
            showToast: msg => {
                alert(msg);
            },
            goBack: (path, params) => {
                window.history.back();
            },
            getGeoLocation: () => {},
            invokeSystemBrowser: params => {
                window.location.href = JSON.parse(params).url;
            },
            getCurrentLoginInfo: () => {},
            destoryMapFeature: () => {},
            clientInfo: {
                safeBottom: window.safeBottom || 0,
                safeTop: window.safeTop || 40,
                location: { longitude: 116.460704, latitude: 39.9579, accuracy: 46.963593 },
                coverBottomHeight: 0,
                user: {
                    userId: "7281222021835534336",
                    name: "通通用户",
                    avatar: "https://img1.baidu.com/it/u=3659556470,999557894&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
                    gender: 1,
                    token: "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzI4MDQ5MDkxODczOTI4ODA2NCIsImlzcyI6InRvbmd0b25nIiwic3ViIjoiNzI4MDQ5MDkxODczOTI4ODA2NCIsImV4cCI6MTc0NTQxMDk1MCwiaWF0IjoxNzQyODE4OTUwfQ.g3FyX6erU6O0BNKlAjMuLB--fD9We9QtgtKfD0j-T8M"
                    // userId: "7179037632769421312", name: "通通用户", avatar: "https://img1.baidu.com/it/u=3659556470,999557894&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500", gender: 1,
                    // token: "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNzE3OTAzNzYzMjc2OTQyMTMxMiIsImlzcyI6InRvbmd0b25nIiwic3ViIjoiNzE3OTAzNzYzMjc2OTQyMTMxMiIsImV4cCI6MTczODM5ODcyMCwiaWF0IjoxNzM1ODA2NzIwfQ.H_hdvduytlaQkY9e3kazn9bjO1QycYGyTz65JmHmR2M"
                },
                // 此版本和app端内保持一致 随时更改
                appVersion: "3.0.0",
                bridgeVersion: 3
            },
            showSliderView: () => {
                console.log("showSliderView");
            }
        };
        super.defineFunc();
    }
}
